<?php

require_once('conf/DBConfig.php');

class DBConnection extends DBConfig{
	private static $instance;
 
	private function __construct(){
    	self::$instance = mysql_connect(parent::$db_host,  parent::$db_username,  parent::$db_password) or DIE('Error en la conexion');
        $db = mysql_select_db(parent::$db_dbname, self::$instance) or DIE("unable to select DB");
    }
 	
    public static function getInstance(){
		if(empty(self::$instance)){
			self::$instance = new DBConnection();
        }
        return self::$instance;
  	}
}
?>